<div v-cloak id="app" class="main-content">
    <one-table
        :option="option"
        :data="data"
        :loading="loading"
        @current-change="handleCurrentChange"
        @size-change="handleSizeChange"
    >
        <template slot="info" slot-scope="scope">
            <span style="text-align:left" v-html="scope.row.info"></span>
        </template>
    </one-table>
</div>
{include file="common@components/one-table"}
<script>
    new Vue({
        el: "#app",
        data() {
            return {
                loading: false,
                data: [],
                option: {
                    index: false,
                    header: true,
                    selection: false,
                    page: {},
                    size: "mini",
                    column: [
                        {
                            label: "域名",
                            prop: "domain",
                        },
                        {
                            label: "系统信息",
                            prop: "info",
                            slot: true
                        },
                        {
                            label: "记录时间",
                            prop: "create_time",
                        },
                    ],
                },
            };
        },
        created() {
            this.getData();
        },
        methods: {
            // 获取数据
            getData() {
                let _this = this;
                _this.loading = true;
                request({
                    params: {
                        s: "upgrade/black/index",
                        page: _this.option.page.currentPage,
                        limit: _this.option.page.pageSize,
                    },
                    method: "post",
                }).then((e) => {
                    _this.loading = false;
                    _this.data = e.data.data.list;
                    _this.option.page.total = e.data.data.count;
                });
            },
            //分页
            handleCurrentChange(currentPage) {
                let _this = this;
                _this.option.page.currentPage = currentPage;
                _this.getData();
            },
            //每页显示数
            handleSizeChange(val) {
                let _this = this;
                _this.option.page.pageSize = val;
                _this.getData();
            },
        },
    });
</script>
